package com.liusand.activity.mapper;

import com.liusand.entity.pojo.ActivityInfo;
import com.liusand.entity.pojo.RedPackageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author :liusha
 * packageName :com.liusand.activity.mapper
 * fileName :ActivityMapper
 * creationTime :2022/12/22 16:43
 */
@Mapper
public interface ActivityMapper {
    Integer insertActivityInfo(@Param("activityInfo") ActivityInfo activityInfo);

    Integer insertRedPackageInfos(@Param("redPackageInfoList") List<RedPackageInfo> redPackageInfoList);


    List<ActivityInfo> selectActivityInValidity(@Param("now") Date now);

    List<RedPackageInfo> selectRedPackageInValidity(@Param("activityInfoList") List<ActivityInfo> activityInfoList);

    Integer updateActivityInfoState(@Param("activityInfoList") List<ActivityInfo> activityInfoList,
                                    @Param("newState") Integer newState);

    Integer updateRedPackageInfoById(@Param("id") Integer id, @Param("userId") String userId);
}
